4.6 Lists
HTML supports several elements for making lists.
They can be divided into two types: glossary lists,
and regular lists. Glossary Lists are denoted by
the element <DL>
, while regular lists are denoted
by the elements <UL>
, <OL>
,
<MENU>
and
<DIR>
. Lists can be nested. Thus you can have
a regular list within a regular list, a regular list
within a glossary list, and so on. Some examples are
shown below.
This document describes glossary lists. The following
document ([Next] from the menu at the top of the page)
explains the formatting of regular lists.
4.6.1 DL Element: Glossary Lists
This list type, also known as a definition list, is used
to present a list of items along with descriptive paragraphs.
This can be used for glossaries, but is also useful
for presenting a named list of items and their meanings.
The items within the list are introduced by the two
elements
<DT>
-- The `Term' (a single line)
<DD>
-- The `Definition' (may be multiple lines)
DL can take a single attribute, COMPACT, to signify that the
list is small (or large) and should be rendered in a physically
compact way. This attribute is ignored by several browsers.
4.6.2 Example of DL Lists
Here is an example from the Paragraphs section of this manual (with
a small addition to show a nested regular list:)
<dl>
<dt> Things to Avoid:
<dd> You should NOT use elements that define paragraph
formatting within the PRE element. This means you should
not use <code> <P>, <ADDRESS>, <Hn>
</code>and so
on. You should avoid the use of tab characters -- use single
blank characters to space text apart.
<dt> Things That are OK:
<dd>You <em> can </em> use Anchor. A typed
carriage return will cause a new line in the presented text.
People you should never let format lists include:
<ul>
<li> Bozo the Clown
<li> Uncle Fester
<li> Knights who go nii
</ul>
Which would be downright silly in the first place.
</dl>
This is rendered as:
- Things to Avoid:
- You should NOT use elements that define paragraph
formatting within the PRE element. This means you should
not use
<P>, <ADDRESS>, <Hn>
and so on. You
should avoid the use of tab characters -- use single blank
characters to space text apart.
- Things That are OK:
- You can use Anchor. A typed carriage return will
cause a new line in the presented text.
People you should never let format lists include:
- Bozo the Clown
- Uncle Fester
- Knights who go nii
Which would be downright silly in the first place.
Look at Section 4.6.2 for
information on regular lists.
© Ian Graham 1994-1995
|
Page Last Updated: 4
December 1995
|